﻿
namespace Eugenhome.Atrium.Bookmark.Web
{
    /// <summary>
    /// 
    /// </summary>
    public class BookmarkItem
    {
        /// <summary></summary>
        private Bookmark _bookmark;

        /// <summary></summary>
        public string ID { get { return _bookmark.ID.ToString(); } }

        /// <summary></summary>
        public string Target { get { return _bookmark.OpenInNewWindow ? "_blank" : "_top"; } }

        /// <summary></summary>
        public string Icon { get { return _bookmark.Icon; } }

        /// <summary></summary>
        public string Href { get { return _bookmark.Crypted ? "open.aspx?url=" + _bookmark.Href : _bookmark.Href; } }

        /// <summary></summary>
        public string CssClass { get { return _bookmark.Crypted ? "crypted" : ""; } }

        /// <summary></summary>
        public string CryptedHref { get { return _bookmark.Crypted ? "" : _bookmark.Href; } }

        /// <summary></summary>
        public string DisplayName { get { return _bookmark.DisplayName; } }

        /// <summary></summary>
        public string IconVisibility { get { return (Icon==null || Icon.Equals(string.Empty)) ? "hidden" : "visible"; } }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="bookmark"></param>
        public BookmarkItem(Bookmark bookmark)
        {
            _bookmark = bookmark;
        }
    }
}